package com.ai.platform.spider.logger;

/**
 * 功能描述
 * 创建者 yeyingsheng
 * 创建时间 2018年06月22日
 */
public interface Logger {
    byte LEVEL_INFO		= 1;
    byte LEVEL_DEBUG	= 2;
    byte LEVEL_WARN		= 3;
    byte LEVEL_ERROR	= 4;
    byte LEVEL_OFF		= 5;

    static Byte getLevel(String l) {
        Byte level = null;
        switch(l) {
            case "OFF":
                level = Logger.LEVEL_OFF;
                break;
            case "DEBUG":
                level = Logger.LEVEL_DEBUG;
                break;
            case "WARN":
                level = Logger.LEVEL_WARN;
                break;
            case "ERROR":
                level = Logger.LEVEL_ERROR;
                break;
            default:
                level = Logger.LEVEL_INFO;
                break;
        }
        return level;
    }

    void info(String msg);
    void debug(String msg);
    void warn(String msg);
    void error(String err, Throwable e);
}
